<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 포인트 사용 내역 컨트롤러
 */
class Point_history extends CI_Controller {
	
	var $data = array();
	
	function __construct() {
		parent::__construct();
		$this->data['sess_userinfo'] = $this->session->userdata('userinfo');

		$this->load->model('mypage/Pointhistory_model', 'point', TRUE);
		$this->load->helper(array('pagenavi'));
	}

	// Default
	function index() {
		log_message('debug', "@@@@ Point_history::index()");
		
		$page = $this->input->get('page', TRUE);
		$current_page = empty($page) ? 1 : $page;

		$page_size  = MYPAGE_PAGE_SIZE;		// 한 페이지에 보여줄 글 수
		$block_size = MYPAGE_BLOCK_SIZE;	// 네비영역의 한 블록에 보여줄 페이지 수

		$total_cnt  = $this->point->get_point_history_total_count($this->data['sess_userinfo']['user_id']);	// 총 글 수

		$this->data['list'] = $this->point->select_point_history_list($this->data['sess_userinfo']['user_id'], $current_page, $page_size);
		$this->data['navi'] = page_navigation($current_page, $total_cnt, $page_size, $block_size, $this->uri->uri_string());

		$this->data['hurry_list'] = $this->point->select_point_history_hurry_list($this->data['sess_userinfo']['user_id']);

		// 가입상품 요약 정보
		$this->load->model('mypage/Member_model', 'member', TRUE);
		$data['summary'] = $this->member->get_summary($this->data['sess_userinfo']['user_id']);
		$this->data['INC_SUMMARY'] = $this->load->view('inc/summary_v', $data, TRUE);
		
		$this->load->view('mypage/point_history_v', $this->data);
	}
}

/* End of file point_history.php */
/* Location: ./application/controllers/mypage/point_history.php */